package com.mustafaiev.tair.cts.facade;

import java.util.List;

import com.mustafaiev.tair.cts.dto.PayerDTO;
import com.mustafaiev.tair.cts.exeption.DataNotRemovedException;
import com.mustafaiev.tair.cts.exeption.DataNotRetrievedException;
import com.mustafaiev.tair.cts.exeption.DataNotStoredException;

/**
 * IPayerFacade
 * 
 * @author tair
 * 
 */
public interface IPayerFacade extends ICostTrackingSystemFacade {

	/**
	 * Saves payer into database
	 * 
	 * @param payer
	 * @throws DataNotStoredException
	 */
	void savePayer(PayerDTO payer) throws DataNotStoredException;

	/**
	 * Updates payer in database
	 * 
	 * @param payer
	 * @throws DataNotStoredException
	 */
	void updatePayer(PayerDTO payer) throws DataNotStoredException;

	/**
	 * Retrieves payers
	 * 
	 * @return
	 * @throws DataNotRetrievedException
	 */
	List<PayerDTO> retrievePayers() throws DataNotRetrievedException;

	/**
	 * Retrieves payer by ID
	 * 
	 * @param payerId
	 * @return
	 * @throws DataNotRetrievedException
	 */
	PayerDTO retrievePayer(Long payerId) throws DataNotRetrievedException;

	/**
	 * Find payer by passed object
	 * 
	 * @param param
	 * @return
	 * @throws DataNotRetrievedException
	 */
	PayerDTO findPayer(String param) throws DataNotRetrievedException;

	/**
	 * Deletes payers
	 * 
	 * @param payersToDelete
	 * @throws DataNotRemovedException
	 */
	void deletePayers(List<PayerDTO> payersToDelete)
			throws DataNotRemovedException;

	/**
	 * Retrieves payer by email
	 * 
	 * @param email
	 * @return PayerDTO
	 * @throws DataNotRetrievedException
	 */
	PayerDTO retrieveActiveByEmail(String email)
			throws DataNotRetrievedException;

	/**
	 * Retrieves payers for current group
	 * 
	 * @param id
	 * @return
	 * @throws DataNotRetrievedException
	 */
	List<PayerDTO> retrievePayersForGroup(Long id)
			throws DataNotRetrievedException;

}
